package com.jingdianjichi.subject.common.enums;

import lombok.Getter;

@Getter
public enum SubjectInfoTypeCodeEnum {

    RADIO(1, "单选"),
    MULTIPLE(2, "多选"),
    JUDGE(3, "判断"),
    BRIEF(4, "简答");


    public int code;
    public String desc;

    SubjectInfoTypeCodeEnum(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static SubjectInfoTypeCodeEnum getByCode(int codeVal){
        for(SubjectInfoTypeCodeEnum resultCodeEnum: SubjectInfoTypeCodeEnum.values()){
            if(resultCodeEnum.code == codeVal){
                return resultCodeEnum;
            }
        }
        return null;
    }

}
